package io.github.topcatv.mall.common.ao;

import io.github.topcatv.mall.model.sys.entity.Permission;
import lombok.Data;
import org.springframework.cglib.beans.BeanCopier;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 菜单权限
 *
 * @author liuyi
 */
@Data
public class MenuAo implements Serializable {
    private static final BeanCopier MENU_COPIER = BeanCopier.create(Permission.class, MenuAo.class, false);
    private Integer id;

    private String name;

    private Integer level;

    private Integer type;

    private String title;

    private String path;

    private String component;

    private String icon;

    private String description;

    private BigDecimal sortOrder;

    private Boolean enabled;

    private String url;

    private List<MenuAo> children;

    public MenuAo() {
    }

    public MenuAo(Permission permission) {
        MENU_COPIER.copy(permission, this, null);
    }

}
